package com.snail.auth.entity;

import lombok.Data;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;

/**
 * 组织机构
 */
@Data
@Entity
@Table
public class AuthOrg implements Serializable {
    @Id
    private Long id;

    @Column(length = 12)
    private String code;//组织结构代码

    @Column(length = 30)
    private String name;//名称

    @Column(length = 32)
    private Long parentId;

    private Integer functionType;//业务职能类型 0-分组 1-办公；2-业务支持；5-区域公司主体 6-配送中心；7-仓储库；8-物流；9-门店
    private Integer sort;
    private Integer readonly;//部分部门不允许修改 1-是；0-否
    private Integer flag;//状态标志位

    public AuthOrg() {
    }
    public AuthOrg(Long id, String code, String name, Long parentId, Integer functionType, Integer sort, Integer flag) {
        this.id = id;
        this.code = code;
        this.name = name;
        this.parentId = parentId;
        this.functionType = functionType;
        this.sort = sort;
        this.flag = flag;
    }
}
